-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asymmetric line flow (Refined); READY FOR REVIEW !!! #789
base: develop
Are you sure you want to change the base?
Conversation
"ObjScale" => 1) | ||
"ObjScale" => 1, | ||
"asymmetrical_trans_flow_limit" => 0 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
) | |
) |
L = length(as_vector(:Network_Lines)) | ||
inputs_nw["L"] = L | ||
L_asym = 0 # Default number of asymmetrical lines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
L_asym = 0 # Default number of asymmetrical lines | |
L_asym = 0 # Default number of asymmetrical lines |
… asymmetrical flows
…olumns for bidirectional asymmetric flow
0002caf
to
0e224c5
Compare
…refined write_expansion
for i in 1:L | ||
if i in inputs["EXPANSION_LINES"] | ||
transcap[i] = value.(EP[:vNEW_TRANS_CAP][i]) | ||
elseif i in inputs["EXPANSION_LINES_ASYM"] | ||
transcap_pos[i] = value.(EP[:vNEW_TRANS_CAP_Pos][i]) | ||
transcap_neg[i] = value.(EP[:vNEW_TRANS_CAP_Neg][i]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
transcap_neg[i] = value.(EP[:vNEW_TRANS_CAP_Neg][i]) | |
transcap_neg[i] = value.(EP[:vNEW_TRANS_CAP_Neg][i]) |
…t partitioning of symmetric and asymmetric rows on network dataframe and introducing additional associated decision variables into the code-base
…ing bidirectional asymmetric flows
Hi @JesseJenkins and @lbonaldo , I have pushed all the modifications to the code base for this PR. Few things to note: First of all, as you will see, it's way more lengthy and complicated than what Jesse suggested to me previously. I first tried with the simpler version. But, was getting bidirectional flows on the asymmetric lines with Qian's example case even when we restricted the flow limits to zero in one of the directions for the asymmetric lines. With some pondering, I realized that I was doing wrong indexing on the constraints and decision variables. So, I had to do a bit more digging and refining the code. The fundamental reasons for which the code is so much lengthier are: 1) I have both symmetric as well as asymmetric lines in a system and 2) In order to maintain backward compatibility with the existing example cases (As you will observe, I had to go to lengths to split the data-frame into two parts and assign separate variables and constraint names so that things stay clean and correct. I could not find an easier way to do this. I'll highly appreciate any feedback on this). We tested with @qluo0320github 's example cases and it seems the results are sensible (?) However, I still get discrepancies when I benchmark against an actually symmetric system versus a "simulated" symmetric system (in which the asymmetric lines have the same flow limits, loss percentages, and transmission buildout in both directions). I am attaching hereby all the relevant flow comparison I scrutinized the code several times, but couldn't spot any flaw so far. I would appreciate if you could point some obvious bug (if at all) that I might have missed. Also, I would appreciate taking a look at the quadratic loss formulation. I believe I did it right, but am not totally certain. Thank you so much !!! I have also updated most of the doc pages; I will wrap up parts of the transmission.jl doc page and make another push to close this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 280 to 282 in 7d90bd9
if setup["asymmetrical_trans_flow_limit"] ==1 |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 289 to 290 in 7d90bd9
cMaxFlow_out_asym[l = 1:L_asym, t = 1:T], vFLOW[(l+L_sym), t] <= EP[:eAvail_Trans_Cap_Pos][l] #Change these with Auxiliary | |
cMaxFlow_in_asym[l = 1:L_asym, t = 1:T], vFLOW[(l+L_sym), t] >= -EP[:eAvail_Trans_Cap_Neg][l] #Change these with Auxiliary |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 294 to 297 in 7d90bd9
begin | |
cMaxFlow_out[l = 1:L, t = 1:T], vFLOW[l, t] <= EP[:eAvail_Trans_Cap][l] | |
cMaxFlow_in[l = 1:L, t = 1:T], vFLOW[l, t] >= -EP[:eAvail_Trans_Cap][l] | |
end) |
[JuliaFormatter] reported by reviewdog 🐶
[JuliaFormatter] reported by reviewdog 🐶
if setup["asymmetrical_trans_flow_limit"] ==1 |
[JuliaFormatter] reported by reviewdog 🐶
inputs["pPercent_Loss_Pos"][l] * (vTAUX_POS_ASYM[l, t]) + inputs["pPercent_Loss_Neg"][l] * (vTAUX_NEG_ASYM[l, t]) |
[JuliaFormatter] reported by reviewdog 🐶
vTAUX_POS_ASYM[l, t] - vTAUX_NEG_ASYM[l, t] == vFLOW[(l+L_sym), t] |
[JuliaFormatter] reported by reviewdog 🐶
vTAUX_POS_ASYM[l, t] + vTAUX_NEG_ASYM[l, t] <= min(EP[:eAvail_Trans_Cap_Pos][l], EP[:eAvail_Trans_Cap_Neg][l]) |
[JuliaFormatter] reported by reviewdog 🐶
vTAUX_NEG[l, t] <= EP[:eAvail_Trans_Cap][l] - vPROD_TRANSCAP_ON[l, t] |
[JuliaFormatter] reported by reviewdog 🐶
vTAUX_NEG_ASYM[l, t] <= EP[:eAvail_Trans_Cap_Neg][l] - vPROD_TRANSCAP_ON_NEG_ASYM[l, t] |
[JuliaFormatter] reported by reviewdog 🐶
vTAUX_POS_ASYM[l, t] <= EP[:eAvail_Trans_Cap_Pos][l] - vPROD_TRANSCAP_ON_POS_ASYM[l, t] |
[JuliaFormatter] reported by reviewdog 🐶
(1 - vTAUX_POS_ON_POS_ASYM[l, t]) * inputs["pTrans_Max_Possible_Pos"][l] |
[JuliaFormatter] reported by reviewdog 🐶
(1 - vTAUX_POS_ON_NEG_ASYM[l, t]) * inputs["pTrans_Max_Possible_Neg"][l] |
[JuliaFormatter] reported by reviewdog 🐶
vTAUX_NEG[l, t] <= EP[:eAvail_Trans_Cap][l] - vPROD_TRANSCAP_ON[l, t] |
[JuliaFormatter] reported by reviewdog 🐶
if setup["asymmetrical_trans_flow_limit"] ==1 |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 470 to 471 in 7d90bd9
sum((2 * s - 1) * (inputs["pTrans_Max_Possible"][l] / TRANS_LOSS_SEGS) * | |
vTAUX_POS[l, s, t] for s in 1:TRANS_LOSS_SEGS)) + |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 473 to 474 in 7d90bd9
sum((2 * s - 1) * (inputs["pTrans_Max_Possible"][l] / TRANS_LOSS_SEGS) * | |
vTAUX_NEG[l, s, t] for s in 1:TRANS_LOSS_SEGS))) |
[JuliaFormatter] reported by reviewdog 🐶
sum(vTAUX_POS[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_POS[l, 0, t] == |
[JuliaFormatter] reported by reviewdog 🐶
sum(vTAUX_NEG[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_NEG[l, 0, t] == |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderPos2[l in LOSS_LINES_SYM, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderNeg2[l in LOSS_LINES_SYM, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 548 to 549 in 7d90bd9
sum((2 * s - 1) * (inputs["pTrans_Max_Possible_Pos"][l] / TRANS_LOSS_SEGS) * | |
vTAUX_POS_ASYM[l, s, t] for s in 1:TRANS_LOSS_SEGS)) + |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 551 to 552 in 7d90bd9
sum((2 * s - 1) * (inputs["pTrans_Max_Possible_Neg"][l] / TRANS_LOSS_SEGS) * | |
vTAUX_NEG_ASYM[l, s, t] for s in 1:TRANS_LOSS_SEGS))) |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 558 to 559 in 7d90bd9
sum(vTAUX_POS_ASYM[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_POS_ASYM[l, 0, t] == | |
vFLOW[(l+L_sym), t] |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 561 to 562 in 7d90bd9
sum(vTAUX_NEG_ASYM[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_NEG_ASYM[l, 0, t] == | |
-vFLOW[(l+L_sym), t] |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxMaxNeg_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderPos1_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderNeg1_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderPos2_asym[l in LOSS_LINES_ASYM, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderNeg2_asym[l in LOSS_LINES_ASYM, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
inputs["pTrans_Max_Possible_Pos"][l] * (1 - vTAUX_POS_ON_ASYM[l, 1, t]) |
[JuliaFormatter] reported by reviewdog 🐶
inputs["pTrans_Max_Possible_Neg"][l] * (1 - vTAUX_NEG_ON_ASYM[l, 1, t]) |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 625 to 626 in 7d90bd9
sum((2 * s - 1) * (inputs["pTrans_Max_Possible"][l] / TRANS_LOSS_SEGS) * | |
vTAUX_POS[l, s, t] for s in 1:TRANS_LOSS_SEGS)) + |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 628 to 629 in 7d90bd9
sum((2 * s - 1) * (inputs["pTrans_Max_Possible"][l] / TRANS_LOSS_SEGS) * | |
vTAUX_NEG[l, s, t] for s in 1:TRANS_LOSS_SEGS))) |
[JuliaFormatter] reported by reviewdog 🐶
sum(vTAUX_POS[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_POS[l, 0, t] == |
[JuliaFormatter] reported by reviewdog 🐶
sum(vTAUX_NEG[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_NEG[l, 0, t] == |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderPos2[l in LOSS_LINES, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderNeg2[l in LOSS_LINES, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
|
||
# Transmission capacity of the network (in MW) & Maximum possible flow after reinforcement for use in linear segments of piecewise approximation | ||
if setup["asymmetrical_trans_flow_limit"] == 1 | ||
inputs_nw["pTrans_Max_Possible"] = inputs_nw["pTrans_Max"] = convert(Array{Float64}, filtered_vector_sym(network_var, :Asymmetrical, :Line_Max_Flow_MW)) / scale_factor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
inputs_nw["pTrans_Max_Possible"] = inputs_nw["pTrans_Max"] = convert(Array{Float64}, filtered_vector_sym(network_var, :Asymmetrical, :Line_Max_Flow_MW)) / scale_factor | |
inputs_nw["pTrans_Max_Possible"] = inputs_nw["pTrans_Max"] = convert( | |
Array{Float64}, | |
filtered_vector_sym(network_var, :Asymmetrical, :Line_Max_Flow_MW)) / | |
scale_factor |
if setup["asymmetrical_trans_flow_limit"] == 1 | ||
inputs_nw["pTrans_Max_Possible"] = inputs_nw["pTrans_Max"] = convert(Array{Float64}, filtered_vector_sym(network_var, :Asymmetrical, :Line_Max_Flow_MW)) / scale_factor | ||
# Transmission capacity of the network for asymmetrical lines; onward direction (in MW) | ||
inputs_nw["pTrans_Max_Possible_Pos"] = inputs_nw["pTrans_Max_Pos"] = convert(Array{Float64}, filtered_vector(network_var, :Asymmetrical, :Line_Max_Flow_MW))/ scale_factor # convert to GW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
inputs_nw["pTrans_Max_Possible_Pos"] = inputs_nw["pTrans_Max_Pos"] = convert(Array{Float64}, filtered_vector(network_var, :Asymmetrical, :Line_Max_Flow_MW))/ scale_factor # convert to GW | |
inputs_nw["pTrans_Max_Possible_Pos"] = inputs_nw["pTrans_Max_Pos"] = convert( | |
Array{Float64}, | |
filtered_vector(network_var, :Asymmetrical, :Line_Max_Flow_MW)) / scale_factor # convert to GW |
|
||
# Transmission capacity of the network for asymmetrical lines; return direction(in MW) | ||
inputs_nw["pTrans_Max_Possible_Neg"] = inputs_nw["pTrans_Max_Neg"] = convert(Array{Float64}, filtered_vector(network_var, :Asymmetrical, :Line_Max_Flow_MW_Neg)) / scale_factor # convert to GW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
inputs_nw["pTrans_Max_Possible_Neg"] = inputs_nw["pTrans_Max_Neg"] = convert(Array{Float64}, filtered_vector(network_var, :Asymmetrical, :Line_Max_Flow_MW_Neg)) / scale_factor # convert to GW | |
inputs_nw["pTrans_Max_Possible_Neg"] = inputs_nw["pTrans_Max_Neg"] = convert( | |
Array{Float64}, | |
filtered_vector(network_var, :Asymmetrical, :Line_Max_Flow_MW_Neg)) / | |
scale_factor # convert to GW |
# Transmission capacity of the network for asymmetrical lines; return direction(in MW) | ||
inputs_nw["pTrans_Max_Possible_Neg"] = inputs_nw["pTrans_Max_Neg"] = convert(Array{Float64}, filtered_vector(network_var, :Asymmetrical, :Line_Max_Flow_MW_Neg)) / scale_factor # convert to GW | ||
else | ||
inputs_nw["pTrans_Max_Possible"] = inputs_nw["pTrans_Max"] = to_floats(:Line_Max_Flow_MW) / scale_factor # convert to GW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
inputs_nw["pTrans_Max_Possible"] = inputs_nw["pTrans_Max"] = to_floats(:Line_Max_Flow_MW) / scale_factor # convert to GW | |
inputs_nw["pTrans_Max_Possible"] = inputs_nw["pTrans_Max"] = to_floats(:Line_Max_Flow_MW) / | |
scale_factor # convert to GW |
if setup["Trans_Loss_Segments"] == 1 | ||
# Line percentage Loss - valid for case when modeling losses as a fixed percent of absolute value of power flows | ||
inputs_nw["pPercent_Loss"] = to_floats(:Line_Loss_Percentage) | ||
if setup["asymmetrical_trans_flow_limit"] == 1 | ||
inputs_nw["pTrans_Loss_Coef"] = inputs_nw["pPercent_Loss"] = convert(Array{Float64}, filtered_vector_sym(network_var, :Asymmetrical, :Line_Loss_Percentage)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
inputs_nw["pTrans_Loss_Coef"] = inputs_nw["pPercent_Loss"] = convert(Array{Float64}, filtered_vector_sym(network_var, :Asymmetrical, :Line_Loss_Percentage)) | |
inputs_nw["pTrans_Loss_Coef"] = inputs_nw["pPercent_Loss"] = convert( | |
Array{Float64}, | |
filtered_vector_sym(network_var, :Asymmetrical, :Line_Loss_Percentage)) |
@constraint(EP, cExistingTransCapPos[l = 1:L_asym], vTRANSMAX_Pos[l]==inputs["pTrans_Max_Pos"][l]) | ||
@constraint(EP, cExistingTransCapNeg[l = 1:L_asym], vTRANSMAX_Neg[l]==inputs["pTrans_Max_Neg"][l]) | ||
else | ||
@constraint(EP, cExistingTransCap[l = 1:L], vTRANSMAX[l]==inputs["pTrans_Max"][l]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
@constraint(EP, cExistingTransCap[l = 1:L], vTRANSMAX[l]==inputs["pTrans_Max"][l]) | |
@constraint(EP, cExistingTransCap[l = 1:L], | |
vTRANSMAX[l]==inputs["pTrans_Max"][l]) |
if setup["asymmetrical_trans_flow_limit"] == 1 | ||
@constraint(EP, | ||
cMaxFlowPossible[l in EXPANSION_LINES], | ||
eAvail_Trans_Cap[l]<=inputs["pTrans_Max_Possible"][l]) | ||
@constraint(EP, | ||
cMaxFlowPossible_Pos[l in EXPANSION_LINES_ASYM], | ||
eAvail_Trans_Cap_Pos[l]<=inputs["pTrans_Max_Possible_Pos"][l]) | ||
@constraint(EP, | ||
cMaxFlowPossible_Neg[l in EXPANSION_LINES_ASYM], | ||
eAvail_Trans_Cap_Neg[l]<=inputs["pTrans_Max_Possible_Neg"][l]) | ||
else | ||
@constraint(EP, | ||
cMaxFlowPossible[l in EXPANSION_LINES], | ||
eAvail_Trans_Cap[l]<=inputs["pTrans_Max_Possible"][l]) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
if setup["asymmetrical_trans_flow_limit"] == 1 | |
@constraint(EP, | |
cMaxFlowPossible[l in EXPANSION_LINES], | |
eAvail_Trans_Cap[l]<=inputs["pTrans_Max_Possible"][l]) | |
@constraint(EP, | |
cMaxFlowPossible_Pos[l in EXPANSION_LINES_ASYM], | |
eAvail_Trans_Cap_Pos[l]<=inputs["pTrans_Max_Possible_Pos"][l]) | |
@constraint(EP, | |
cMaxFlowPossible_Neg[l in EXPANSION_LINES_ASYM], | |
eAvail_Trans_Cap_Neg[l]<=inputs["pTrans_Max_Possible_Neg"][l]) | |
else | |
@constraint(EP, | |
cMaxFlowPossible[l in EXPANSION_LINES], | |
eAvail_Trans_Cap[l]<=inputs["pTrans_Max_Possible"][l]) | |
end | |
if setup["asymmetrical_trans_flow_limit"] == 1 | |
@constraint(EP, | |
cMaxFlowPossible[l in EXPANSION_LINES], | |
eAvail_Trans_Cap[l]<=inputs["pTrans_Max_Possible"][l]) | |
@constraint(EP, | |
cMaxFlowPossible_Pos[l in EXPANSION_LINES_ASYM], | |
eAvail_Trans_Cap_Pos[l]<=inputs["pTrans_Max_Possible_Pos"][l]) | |
@constraint(EP, | |
cMaxFlowPossible_Neg[l in EXPANSION_LINES_ASYM], | |
eAvail_Trans_Cap_Neg[l]<=inputs["pTrans_Max_Possible_Neg"][l]) | |
else | |
@constraint(EP, | |
cMaxFlowPossible[l in EXPANSION_LINES], | |
eAvail_Trans_Cap[l]<=inputs["pTrans_Max_Possible"][l]) | |
end |
end | ||
#END network expansion contraints | ||
|
||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
end | |
end |
@variable(EP, vTAUX_NEG_ASYM[l in LOSS_LINES_ASYM, s = 0:TRANS_LOSS_SEGS, t = 1:T]>=0) | ||
@variable(EP, vTAUX_POS_ASYM[l in LOSS_LINES_ASYM, s = 0:TRANS_LOSS_SEGS, t = 1:T]>=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
@variable(EP, vTAUX_NEG_ASYM[l in LOSS_LINES_ASYM, s = 0:TRANS_LOSS_SEGS, t = 1:T]>=0) | |
@variable(EP, vTAUX_POS_ASYM[l in LOSS_LINES_ASYM, s = 0:TRANS_LOSS_SEGS, t = 1:T]>=0) | |
@variable(EP, | |
vTAUX_NEG_ASYM[l in LOSS_LINES_ASYM, s = 0:TRANS_LOSS_SEGS, t = 1:T]>=0) | |
@variable(EP, | |
vTAUX_POS_ASYM[l in LOSS_LINES_ASYM, s = 0:TRANS_LOSS_SEGS, t = 1:T]>=0) |
sum(abs(inputs["pNet_Map"][l, z]) * (1 / 2) * vTLOSS[l, t] for l in LOSS_LINES_SYM) | ||
+ sum(abs(inputs["pNet_Map"][l, z]) * (1 / 2) * vTLOSS_ASYM[l, t] for l in LOSS_LINES_ASYM)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
sum(abs(inputs["pNet_Map"][l, z]) * (1 / 2) * vTLOSS[l, t] for l in LOSS_LINES_SYM) | |
+ sum(abs(inputs["pNet_Map"][l, z]) * (1 / 2) * vTLOSS_ASYM[l, t] for l in LOSS_LINES_ASYM)) | |
sum(abs(inputs["pNet_Map"][l, z]) * (1 / 2) * vTLOSS[l, t] | |
for l in LOSS_LINES_SYM) | |
+sum(abs(inputs["pNet_Map"][l, z]) * (1 / 2) * vTLOSS_ASYM[l, t] | |
for l in LOSS_LINES_ASYM)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderNeg2_asym[l in LOSS_LINES_ASYM, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
inputs["pTrans_Max_Possible_Pos"][l] * (1 - vTAUX_POS_ON_ASYM[l, 1, t]) |
[JuliaFormatter] reported by reviewdog 🐶
inputs["pTrans_Max_Possible_Neg"][l] * (1 - vTAUX_NEG_ON_ASYM[l, 1, t]) |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 628 to 629 in 146916a
sum((2 * s - 1) * (inputs["pTrans_Max_Possible"][l] / TRANS_LOSS_SEGS) * | |
vTAUX_POS[l, s, t] for s in 1:TRANS_LOSS_SEGS)) + |
[JuliaFormatter] reported by reviewdog 🐶
GenX.jl/src/model/core/transmission/transmission.jl
Lines 631 to 632 in 146916a
sum((2 * s - 1) * (inputs["pTrans_Max_Possible"][l] / TRANS_LOSS_SEGS) * | |
vTAUX_NEG[l, s, t] for s in 1:TRANS_LOSS_SEGS))) |
[JuliaFormatter] reported by reviewdog 🐶
sum(vTAUX_POS[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_POS[l, 0, t] == |
[JuliaFormatter] reported by reviewdog 🐶
sum(vTAUX_NEG[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_NEG[l, 0, t] == |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderPos2[l in LOSS_LINES, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderNeg2[l in LOSS_LINES, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
|
||
|
||
if setup["asymmetrical_trans_flow_limit"] ==1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
if setup["asymmetrical_trans_flow_limit"] ==1 | |
if setup["asymmetrical_trans_flow_limit"] == 1 |
cMaxFlow_out_asym[l = 1:L_asym, t = 1:T], vFLOW[(l+L_sym), t] <= EP[:eAvail_Trans_Cap_Pos][l] #Change these with Auxiliary | ||
cMaxFlow_in_asym[l = 1:L_asym, t = 1:T], vFLOW[(l+L_sym), t] >= -EP[:eAvail_Trans_Cap_Neg][l] #Change these with Auxiliary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
cMaxFlow_out_asym[l = 1:L_asym, t = 1:T], vFLOW[(l+L_sym), t] <= EP[:eAvail_Trans_Cap_Pos][l] #Change these with Auxiliary | |
cMaxFlow_in_asym[l = 1:L_asym, t = 1:T], vFLOW[(l+L_sym), t] >= -EP[:eAvail_Trans_Cap_Neg][l] #Change these with Auxiliary | |
cMaxFlow_out_asym[l = 1:L_asym, t = 1:T], | |
vFLOW[(l + L_sym), t] <= EP[:eAvail_Trans_Cap_Pos][l] #Change these with Auxiliary | |
cMaxFlow_in_asym[l = 1:L_asym, t = 1:T], | |
vFLOW[(l + L_sym), t] >= -EP[:eAvail_Trans_Cap_Neg][l] #Change these with Auxiliary |
begin | ||
cMaxFlow_out[l = 1:L, t = 1:T], vFLOW[l, t] <= EP[:eAvail_Trans_Cap][l] | ||
cMaxFlow_in[l = 1:L, t = 1:T], vFLOW[l, t] >= -EP[:eAvail_Trans_Cap][l] | ||
end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
begin | |
cMaxFlow_out[l = 1:L, t = 1:T], vFLOW[l, t] <= EP[:eAvail_Trans_Cap][l] | |
cMaxFlow_in[l = 1:L, t = 1:T], vFLOW[l, t] >= -EP[:eAvail_Trans_Cap][l] | |
end) | |
begin | |
cMaxFlow_out[l = 1:L, t = 1:T], vFLOW[l, t] <= EP[:eAvail_Trans_Cap][l] | |
cMaxFlow_in[l = 1:L, t = 1:T], vFLOW[l, t] >= -EP[:eAvail_Trans_Cap][l] | |
end) |
begin | ||
cMaxFlow_out[l = 1:L, t = 1:T], vFLOW[l, t] <= EP[:eAvail_Trans_Cap][l] | ||
cMaxFlow_in[l = 1:L, t = 1:T], vFLOW[l, t] >= -EP[:eAvail_Trans_Cap][l] | ||
end) | ||
|
||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
cTLoss[l in LOSS_LINES, t = 1:T], | ||
vTLOSS[l, t] == | ||
inputs["pPercent_Loss"][l] * (vTAUX_POS[l, t] + vTAUX_NEG[l, t]) | ||
if setup["asymmetrical_trans_flow_limit"] ==1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
if setup["asymmetrical_trans_flow_limit"] ==1 | |
if setup["asymmetrical_trans_flow_limit"] == 1 |
sum(vTAUX_NEG_ASYM[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_NEG_ASYM[l, 0, t] == | ||
-vFLOW[(l+L_sym), t] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
sum(vTAUX_NEG_ASYM[l, s, t] for s in 1:TRANS_LOSS_SEGS) - vTAUX_NEG_ASYM[l, 0, t] == | |
-vFLOW[(l+L_sym), t] | |
sum(vTAUX_NEG_ASYM[l, s, t] for s in 1:TRANS_LOSS_SEGS) - | |
vTAUX_NEG_ASYM[l, 0, t] == | |
-vFLOW[(l + L_sym), t] |
cTAuxMaxPos_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], | ||
vTAUX_POS_ASYM[l, s, t] <= | ||
(inputs["pTrans_Max_Possible_Pos"][l] / TRANS_LOSS_SEGS) | ||
cTAuxMaxNeg_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
cTAuxMaxNeg_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], | |
cTAuxMaxNeg_asym[ | |
l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
# (These constraints are necessary to prevents phantom losses in MILP problems) | ||
@constraints(EP, | ||
begin | ||
cTAuxOrderPos1_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderPos1_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], | |
cTAuxOrderPos1_asym[ | |
l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
vTAUX_POS_ASYM[l, s, t] <= | ||
(inputs["pTrans_Max_Possible_Pos"][l] / TRANS_LOSS_SEGS) * | ||
vTAUX_POS_ON_ASYM[l, s, t] | ||
cTAuxOrderNeg1_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderNeg1_asym[l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], | |
cTAuxOrderNeg1_asym[ | |
l in LOSS_LINES_ASYM, s = 1:TRANS_LOSS_SEGS, t = 1:T], |
vTAUX_NEG_ASYM[l, s, t] <= | ||
(inputs["pTrans_Max_Possible_Neg"][l] / TRANS_LOSS_SEGS) * | ||
vTAUX_NEG_ON_ASYM[l, s, t] | ||
cTAuxOrderPos2_asym[l in LOSS_LINES_ASYM, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
cTAuxOrderPos2_asym[l in LOSS_LINES_ASYM, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], | |
cTAuxOrderPos2_asym[ | |
l in LOSS_LINES_ASYM, s = 1:(TRANS_LOSS_SEGS - 1), t = 1:T], |
Description
This PR attempts to introduce bidirectional asymmetric transmission lines into the system. Such lines have different values of MW flow limits, loss percentage, and capacity expansion limits along the two directions. While doing so, this PR also ensures that there are also symmetric lines present in the system along with the asymmetric lines and modifies the code in such a way that backwards compatibility is maintained with the existing cases.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Checklist
How this can be tested
Post-approval checklist for GenX core developers
After the PR is approved